<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:if test="${not empty retailerList}">
<table class="table1">
			<tr>
				<th>TIN NO.</th>
				<th>Retailer NAME</th>
				<th>ADDRESS</th>
				<th>EMAIL</th>
				<th>CONTACT</th>
				<th>STATUS</th>
				<th>ADDED(MM/YYYY)</th>
				<th>ACTIONS</th>
			</tr>
			<c:forEach var="listValue" items="${retailerList}">
				<tr>
					<td>${listValue.tinNumber}</td>
					<td>${listValue.retailerName}</td>
					<td>${listValue.retailerAddress}</td>
					<td>${listValue.retailerEmailId}</td>
					<td>${listValue.retailerPhoneNumber},
						${listValue.retailerMobileNumber}</td>
					<td>${listValue.retailerActive}</td>
					<td>${listValue.month}/${listValue.year}</td>
					<td><a
						href="<%=request.getContextPath()%>/admin/retailer/editRetailer/${listValue.retailerId}">EDIT</a>&nbsp;
						<c:choose>
							<c:when test="${listValue.retailerActive=='A'}">
								<span id="active"><a
									href="<%=request.getContextPath()%>/admin/retailer/deactivateRetailer/${listValue.retailerId}"
									id="action">DEACTIVATE</a></span>
							</c:when>
							<c:when test="${listValue.retailerActive=='D'}">
								<span id="inactive"><a
									href="<%=request.getContextPath()%>/admin/retailer/activateRetailer/${listValue.retailerId}"
									id="action">ACTIVATE</a></span>
							</c:when>
						</c:choose>
					</td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
</body>
</html>